package Entities;

//简单图书信息类
public class SimpleBookEntity
{
    private String bookId;
    private String bookName;
    private String author;
    private String star;
    private String contentDes;
    private String imageUrl;

    public SimpleBookEntity(String bookId, String bookName, String author, String star, String contentDes, String imageUrl)
    {
        this.bookId = bookId;
        this.bookName = bookName;
        //若没有作者，则自动把作者设为“佚名”
        if(!author.isEmpty())
            this.author = author;
        else
            this.author = "佚名";

        this.star = star;
        //若没有简介，则自动把简介设为“暂无简介”
        if(!contentDes.isEmpty())
            this.contentDes = contentDes;
        else
            this.contentDes = "暂无简介";

        this.imageUrl = imageUrl;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        //若没有作者，则自动把作者设为“佚名”
        if(!author.isEmpty())
            this.author = author;
        else
            this.author = "佚名";
    }

    public String getStar() {
        return star;
    }

    public void setStar(String star) {
        this.star = star;
    }

    public String getContentDes() {
        return contentDes;
    }

    public void setContentDes(String contentDes) {
        //若没有简介，则自动把简介设为“暂无简介”
        if(!contentDes.isEmpty())
            this.contentDes = contentDes;
        else
            this.contentDes = "暂无简介";
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }
}
